﻿<view:UCModule x:Class="UCOLOR.View.TemplateListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers" 
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UColor.WPF"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1118" FontWeight="Bold" Focusable="True" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
    <view:UCModule.Resources>
        <local:ScalablePaddingConverter x:Key="ScalablePaddingConverter"/>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />
        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:UCModule.Resources>
    <view:DemoModuleControl>
    <Grid Name="Center" Background="#FFFFFFFF" Height="auto" >
        <Border BorderBrush="#FF515151" BorderThickness="1" Margin="2,2,2,2" Padding="1">
            <dxlc:TileLayoutControl x:Name="DirList"  Margin="3,3,3,3" AllowItemMoving="True" Orientation="Vertical" Padding="0" BreakFlowToFit="True" ItemsSource="{Binding data}">
                <dxlc:TileLayoutControl.ItemTemplate>
                    <DataTemplate>
                        <dxlc:Tile Width="120" Height="100" Header="{Binding}" Content="{Binding}" VerticalHeaderAlignment="Stretch" helpers:ZoomHelper.SupressZoomFactor="300"
                                helpers:TileSelectHelper.ComparisonPropertyPath="ID"
                                Padding="0" Click="Tile_Click" MouseDown="Tile_MouseDown">
                                <dxlc:Tile.ToolTip>
                                    <Image RenderOptions.BitmapScalingMode="HighQuality" Source="{Binding PhotoSource}" Stretch="Uniform" />
                                </dxlc:Tile.ToolTip>
                                <dxlc:Tile.HeaderTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <helpers:VisualStateControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                            <Grid>
                                                <Border Background="#DDDDDD" Opacity="0" />
                                                <Grid>
                                                    <Border Background="#DDDDDD" VerticalAlignment="Top" HorizontalAlignment="Left">
                                                        <StackPanel Margin="1,1,1,1">
                                                            <RadioButton  Content="己选"/>
                                                        </StackPanel>
                                                    </Border>
                                                    <Border Background="#DDDDDD" VerticalAlignment="Bottom"   HorizontalAlignment="Right" Margin="2,2,2,2">
                                                     
                                                    </Border>
                                                </Grid>
                                            </Grid>
                                        </helpers:VisualStateControl>

                                    </Grid>
                                </DataTemplate>
                            </dxlc:Tile.HeaderTemplate>
                            <dxlc:Tile.ContentTemplate>
                                <DataTemplate>
                                        <Image Stretch="Fill"  Source="{Binding PhotoSource}"  />
                                </DataTemplate>
                            </dxlc:Tile.ContentTemplate>
                        </dxlc:Tile>
                    </DataTemplate>
                </dxlc:TileLayoutControl.ItemTemplate>
            </dxlc:TileLayoutControl>
        </Border>
    </Grid>
    </view:DemoModuleControl>
</view:UCModule>
